Skip Headers

Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-01 |
Home | Book List | Contents | Index | Master Index | Feedback

Previous | Next
| View PDF

# STATMAX

The STATMAX function returns the latest value in the current status list of a dimension or a dimension surrogate, or in a valueset.

Return Value

The data type returned by STATMAX is either the data type of the dimension or dimension surrogate value or an `INTEGER` that indicates its position in the default status list of the dimension or surrogate. See "Automatic Conversion of Values Returned by STATMAX".

Syntax

STATMAX(dimension)

Arguments

dimension

  A text expression whose value is the name of a dimension, dimension surrogate, or valueset.

Notes

Automatic Conversion of Values Returned by STATMAX

The value that STATMAX returns is converted to a number or a text value as appropriate to the context. For example, suppose that the status of `month` is limited to `Jun95` to `Dec95` and that `Dec95` is the twelfth month in the default status list. The value of `STATMAX(month)` can be assigned either to a text variable or a numeric variable.

The following statements

    DEFINE textvar TEXT
    textvar = STATMAX(month)
    SHOW textvar

produce this output.

    Dec95

In contrast, these statements

    DEFINE intvar INTEGER
    intvar = STATMAX(month)
    SHOW intvar

produce this output.

    12

Examples

Example 22-33 STATMAX Used in a Title

The following statements from a program use STATMAX to determine the latest of the 10 months with the highest total sales.

    LIMIT month TO BOTTOM 10 BASEDON TOTAL(sales, month)
    SHOW JOINCHARS(STATMAX(month) ' is the latest month -
      of the ten months with the lowest sales.')
    SHOW JOINCHARS('the months range from ' STATMIN(month) ' to '-
      STATMAX(month))

These statements produce the following sales report.

    Dec96 is the latest month of the ten months with the lowest sales.
    The months range from Jan95 to Dec96

When you used STATLAST instead of STATMAX, you could have produced a different value, because the LIMIT command arranged the `month` values by increasing sales rather than chronologically.